﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a20
    {
		private string _slistid;
		private string _shopcode;
		private string _shopname;
		private string _cuser;
		private string _ctel;
		private string _cfax;
        private DateTime? _createdate;
		private string _backmk;
        private int? _tranday;
		private string _listid;
		private string _tlistid;
        private int? _statuscode;
		private string _alistid;
		private string _muser;
		private string _vlistid;
		private string _cphone;
		private string _email;
		private string _barcode;
		private string _address;
		
        /// <summary>
        /// 销售商主键
        /// </summary>
		public string Slistid
		{
			get { return _slistid;	 }
			set { _slistid=value;	}
		}
        /// <summary>
        /// 门店代码
        /// </summary>
		public string Shopcode
		{
			get { return _shopcode;	 }
			set { _shopcode=value;	}
		}
        /// <summary>
        /// 门店名称
        /// </summary>
		public string Shopname
		{
			get { return _shopname;	 }
			set { _shopname=value;	}
		}
        /// <summary>
        /// 联系人
        /// </summary>
		public string Cuser
		{
			get { return _cuser;	 }
			set { _cuser=value;	}
		}
        /// <summary>
        /// 联系电话
        /// </summary>
		public string Ctel
		{
			get { return _ctel;	 }
			set { _ctel=value;	}
		}
        /// <summary>
        /// 传真
        /// </summary>
		public string Cfax
		{
			get { return _cfax;	 }
			set { _cfax=value;	}
		}
        /// <summary>
        /// 创建日期
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 可否退货
        /// </summary>
		public string Backmk
		{
			get { return _backmk;	 }
			set { _backmk=value;	}
		}
        /// <summary>
        /// 送货天数
        /// </summary>
		public int? Tranday
		{
			get { return _tranday;	 }
			set { _tranday=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 物流公司主键
        /// </summary>
		public string Tlistid
		{
			get { return _tlistid;	 }
			set { _tlistid=value;	}
		}
        /// <summary>
        /// 状态代码
        /// </summary>
		public int? Statuscode
		{
			get { return _statuscode;	 }
			set { _statuscode=value;	}
		}
        /// <summary>
        /// 区域主键
        /// </summary>
		public string Alistid
		{
			get { return _alistid;	 }
			set { _alistid=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 等级主键
        /// </summary>
		public string Vlistid
		{
			get { return _vlistid;	 }
			set { _vlistid=value;	}
		}
        /// <summary>
        /// 手机
        /// </summary>
		public string Cphone
		{
			get { return _cphone;	 }
			set { _cphone=value;	}
		}
        /// <summary>
        /// 电子邮件
        /// </summary>
		public string Email
		{
			get { return _email;	 }
			set { _email=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Barcode
		{
			get { return _barcode;	 }
			set { _barcode=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Address
		{
			get { return _address;	 }
			set { _address=value;	}
		}
		
		public static List<Bas1a20> GetBas1a20ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a20> list = new List<Bas1a20>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a20 model = GetBas1a20ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a20 GetBas1a20ByDataRow(DataRow dr)
		{
			Bas1a20 model = new Bas1a20(); //实例化Bas1a20
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("slistid")&&!(dr["slistid"] is System.DBNull))  
				model.Slistid = ( string)dr["slistid"];
			if (dcc.Contains("shopcode")&&!(dr["shopcode"] is System.DBNull))  
				model.Shopcode = ( string)dr["shopcode"];
			if (dcc.Contains("shopname")&&!(dr["shopname"] is System.DBNull))  
				model.Shopname = ( string)dr["shopname"];
			if (dcc.Contains("cuser")&&!(dr["cuser"] is System.DBNull))  
				model.Cuser = ( string)dr["cuser"];
			if (dcc.Contains("ctel")&&!(dr["ctel"] is System.DBNull))  
				model.Ctel = ( string)dr["ctel"];
			if (dcc.Contains("cfax")&&!(dr["cfax"] is System.DBNull))  
				model.Cfax = ( string)dr["cfax"];
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("backmk")&&!(dr["backmk"] is System.DBNull))  
				model.Backmk = ( string)dr["backmk"];
			if (dcc.Contains("tranday")&&!(dr["tranday"] is System.DBNull))  
				model.Tranday = ( int)dr["tranday"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("tlistid")&&!(dr["tlistid"] is System.DBNull))  
				model.Tlistid = ( string)dr["tlistid"];
			if (dcc.Contains("statuscode")&&!(dr["statuscode"] is System.DBNull))  
				model.Statuscode = ( int)dr["statuscode"];
			if (dcc.Contains("alistid")&&!(dr["alistid"] is System.DBNull))  
				model.Alistid = ( string)dr["alistid"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("vlistid")&&!(dr["vlistid"] is System.DBNull))  
				model.Vlistid = ( string)dr["vlistid"];
			if (dcc.Contains("cphone")&&!(dr["cphone"] is System.DBNull))  
				model.Cphone = ( string)dr["cphone"];
			if (dcc.Contains("email")&&!(dr["email"] is System.DBNull))  
				model.Email = ( string)dr["email"];
			if (dcc.Contains("barcode")&&!(dr["barcode"] is System.DBNull))  
				model.Barcode = ( string)dr["barcode"];
			if (dcc.Contains("address")&&!(dr["address"] is System.DBNull))  
				model.Address = ( string)dr["address"];
			
			return model;
		}
    }
}
